<template>
  <div>
    <el-table
        :data="pageData" stripe style="width: 100%"
        :header-cell-style="{
                'text-align':'center',
                'background-color':'#F0FFF0'
              }"
        :cell-style="{'text-align':'center'}">
      <el-table-column prop="id" label="序号"></el-table-column>
      <el-table-column prop="number" label="药品编码" width="110px"/>
      <el-table-column prop="drugName" label="药品名称"/>
      <el-table-column prop="prescriptionType " label="处方类别">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.prescription_type" :value="scope.row.prescriptionType"/>
        </template>
      </el-table-column>
      <el-table-column prop="specification" label="规格">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.specification" :value="scope.row.specification"/>
        </template>
      </el-table-column>
      <el-table-column prop="drugForm " label="剂型">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.drug_form" :value="scope.row.drugForm"/>
        </template>
      </el-table-column>
      <el-table-column prop="factory " label="生产厂家">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.factory" :value="scope.row.factory"/>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="150">
        <template slot-scope="scope">
          <el-link type="primary"
                   :underline="false"
                   @click="changePrice(scope.row.id)"
                   class="margin-right">调价
          </el-link>
        </template>
      </el-table-column>
    </el-table>
    <sn-page
        :table-data="tableData"
        class="float-right margin-top-20 margin-bottom-20"
        @getPageData="getPageData"/>
  </div>
</template>

<script>
export default {
  dicts: ['sys_normal_disable','specification','drug_type','prescription_type','factory','drug_status','drug_form'],
  name: "DrugChangePriceTable",
  data() {
    return {
      //每页数据
      pageData: [],
    }
  },
  props: {
    //数据
    tableData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  methods: {
    getPageData(pageData) {
      this.pageData = pageData
    },
    changePrice(id) {
      // 新增药品调价
      this.$router.push({ path: "/yldrug/drugpricing/addpricing/" + id }).catch(()=>{});
      // this.$router.push('/drugManageRoot/newAddChangePrice/' + id)
    }
  },

}
</script>

<style scoped>
</style>
